package com.citcc.business.service;

import java.util.List;

import com.citcc.business.bean.UserOrderEntity;
import com.citcc.business.mapper.UserOrderEntityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.citcc.business.bean.CdzIndent;
import com.citcc.business.mapper.CdzIndentMapper;

@Service
public class CdzIndentService {

    private final CdzIndentMapper cdzIndentMapper;
    private final UserOrderEntityMapper userOrderEntityMapper;

    @Autowired
    public CdzIndentService(CdzIndentMapper cdzIndentMapper,UserOrderEntityMapper userOrderEntityMapper){
        this.cdzIndentMapper=cdzIndentMapper;
        this.userOrderEntityMapper=userOrderEntityMapper;
    }

    public List<CdzIndent> selectAllList(CdzIndent indent){
        return cdzIndentMapper.selectAllList(indent);
    }
    public List<UserOrderEntity> selectAllList(UserOrderEntity order){
        return userOrderEntityMapper.selectAllList(order);
    }

    public int add(CdzIndent indent){
        return cdzIndentMapper.insertSelective(indent);
    }

    public int update(CdzIndent indent){
        return cdzIndentMapper.updateByPrimaryKeySelective(indent);
    }

    public int delete(String id){
        return cdzIndentMapper.deleteByPrimaryKey(id);
    }
    public int deleteOrder(String id){
        return userOrderEntityMapper.deleteFlagByPrimaryKey(id);
    }

    public CdzIndent getCdzIndent(String id){
        return cdzIndentMapper.selectByPrimaryKey(id);
    }
    
    
    public boolean updateStatusV2(CdzIndent indent){
    	return cdzIndentMapper.updateStatusV2(indent)>0;
    }
    
    public boolean updateStatusV0(CdzIndent indent){
    	return cdzIndentMapper.updateStatusV0(indent)>0;
    }
    
    public List<CdzIndent> selectListByCodeAndStatus(CdzIndent indent){
        return cdzIndentMapper.selectListByCodeAndStatus(indent);
    }

}
